POV-Ray : Newsgroups : povray.beta-test : UV Mapping Question : UV Mapping Question Server Time
31 Jul 2024 02:18:22 EDT (-0400)
  UV Mapping Question  
From: Arturo Gonzalez
Date: 16 Sep 2001 15:00:54
Message: <3ba4f6e6@news.povray.org>
Hi,

I've been trying to test UV mapping using the mesh object directive. A
problem I've been unable to solve since the days of MegaPOV is that the UV
mapped texture is applied to the mesh using the same colour of the first
pixel in the positive direction of the { <0,0>,<1,1> } square in the XY
plane. Applying the same texture to a sphere, for instance, works okay. Is
it me that I haven't really understood the meaning of UV mapping? If that's
so, please forgive me. Below follows an example of a sphere and a triangle
mesh with different behaviours.

warm regards,

arthur


/*******************************
 * File: Mesh_Test.pov
 * Testing UV Mapping using the
 * mesh {} object
 *******************************/


camera {
   location <6,0,-80>
   look_at <10,0,0>
   angle 35
   orthographic
}

light_source { <100,100,-100> color rgb <1,1,1> }
light_source { <-100,-100,-100> color rgb <1,1,1> }


/* -----------------------------
          Render Controls
   ----------------------------- */

#declare trace_sphere = 1;
#declare trace_mesh = 1;

/* ------------------------------
              Textures
   ------------------------------ */

#declare White = pigment { color rgb <1,1,1> }

#declare Checkerboard = pigment {
   checker
   color rgb <0,0,1>
   color rgb <0,1,0>
   scale 0.2
}

/* ------------------------------
              Objects
   ------------------------------ */

#if (trace_sphere = 1)
   sphere {
      0,10
      uv_mapping
      pigment { Checkerboard }
   }
#end



#if (trace_mesh = 1)
   mesh {
      triangle { <0,0,0>,<3,1,1>,<6,0,0> }
      triangle { <0,0,0>,<3,-2,0>,<6,0,0> }
      scale 3
      translate 15*x
      uv_mapping
      pigment { Checkerboard }


   }
#end


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.